package exercise3;

import java.util.Scanner;

public class Exercise07_08 {
    public static void main(String []args)
    {
        System.out.println("请输入10个double类型的数：");
        Scanner input=new Scanner(System.in);
        double[] list=new double[10];
        for (int i=0;i<10;i++)
        {
            list[i]=input.nextDouble();
        }
        System.out.println("平均数是："+average(list));
    }

    public static int average(int[] array)
    {
        int result=0;
        for(int i=0;i<array.length;i++)
        {
            result=result+array[i];
        }
        result=result/array.length;
        return result;
    }

    public static double average(double[] array)
    {
        double result=0;
        for(int i=0;i<array.length;i++)
        {
            result=result+array[i];
        }
        result=result/array.length;
        return result;
    }
}
